package com.cy.store.Service.Impl;

import com.cy.store.Entity.District;
import com.cy.store.Mapper.DistrictMapper;
import com.cy.store.Service.IDistrictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 新增收货地址的实现
 */
@Service
public class DistrictServiceImpl implements IDistrictService {
    @Autowired
    private DistrictMapper districtMapper;

    @Override
    public List<District> getDistrictsByParent(String parent) {
        //在网络传输时，为了尽量避免无效数据的传递，可以将无效数据设置为NULL
        //可以节省流量提高效率
        return districtMapper.findByParent(parent);
    }

    @Override
    public String getDistrictNameByCode(String code) {
        return districtMapper.findNameByCode(code);
    }
}

